package com.vhall.component.entity.room;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.vhall.component.entity.room.enums.TerminalEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * 这里统计的是某个房间，某人，使用某种终端，从某个时刻，开始观看时长 的记录
 * 这里有 终端，浏览器，国家 ，地域数据
 * <p>
 * 数据是 task 工程，com.vhall.component.tasks.StatNewTask#syncLiveAttends
 * 0 0/10 * * * ? 每10分钟运行一次
 * 调用
 * 1 get-lives-room-join-info-batch 【直播数据统计查询 > 批量获取直播访问记录】接口而来  http://www.vhallyun.com/docs/show/776
 * 2 get-inav-access-data-batch     【互动数据统计查询 > 批量获取访问记录】
 *
 * @author dongsong
 */
@Data
@TableName("room_attends")
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "RoomAttendsEntity对象", description = "互动直播-访问统计表")
public class RoomAttendsEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


    @ApiModelProperty(value = "il_id")
    @TableField("il_id")
    private Integer ilId;


    @ApiModelProperty(value = "用户id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "watch_account_id")
    @TableField("watch_account_id")
    private Integer watchAccountId;

    @ApiModelProperty(value = "开始时间")
    @TableField("start_time")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "结束时间")
    @TableField("end_time")
    private LocalDateTime endTime;


    @ApiModelProperty(value = "观看时长,单位秒")
    @TableField("duration")
    private Integer duration;

    /**
     * {@link TerminalEnum}
     */
    @ApiModelProperty(value = "终端")
    @TableField("terminal")
    private String terminal;

    @ApiModelProperty(value = "浏览器")
    @TableField("browser")
    private String browser;

    @ApiModelProperty(value = "国家")
    @TableField("country")
    private String country;

    @ApiModelProperty(value = "地域")
    @TableField("province")
    private String province;


    @ApiModelProperty(value = "数据来源 1-直播房间数据 2-互动房间数据")
    @TableField("type")
    private Integer type;


    @ApiModelProperty(value = "创建时间")
    @TableField("created_at")
    private LocalDateTime createdAt;


    @ApiModelProperty(value = "更新时间")
    @TableField("updated_at")
    private LocalDateTime updatedAt;

    @ApiModelProperty(value = "删除时间")
    @TableField("deleted_at")
    private LocalDateTime deletedAt;

    @ApiModelProperty(value = "统计时间")
    @TableField("created_time")
    private LocalDateTime createdTime;


}
